package cn.levi.dict.configuration;

import cn.levi.dict.DefaultDictToolContextHolder;
import cn.levi.dict.DictToolContextHolder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 自动装配类
 *
 * @author lei
 * @since 2024/11/21
 */
@Configuration
@Import(DictFormatProperties.class)
public class DictAutoconfiguration {


	/**
	 * 默认的字典处理器
	 */
	@Bean
	@ConditionalOnMissingBean(DictToolContextHolder.class)
	public DefaultDictToolContextHolder getDefaultDictToolContextHolder() {
		return new DefaultDictToolContextHolder();
	}
}
